package com.example.springbootfoodsafety.service;


import com.example.springbootfoodsafety.entity.User;
import com.example.springbootfoodsafety.po.Article;
import com.example.springbootfoodsafety.po.Speak;
import com.example.springbootfoodsafety.po.Tag;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;


public interface ManageService {
    /*
     * 注册方法
     * */
    public boolean addUser(User user);
    /*
    * 登录方法
    * */
    public User login(String name, String password);

    /***
     * 获取全部用户
     * @return
     */
    public List<User> getAllUser();

    /***
     * 删除用户
     * @param id
     * @return
     */
    public boolean deleteUser(Integer id);
    /***
     *获取全部的文章
     */
    public List<Article> getArticle();
    List<Article>  getTagArticle(Integer tagID);
    /***
     * 根据日期获取全部文章
     * @return
     */
    public List<Article>  getLatestArticle();

    /***
     * 根据点赞获取前6篇文章
     * @return
     */
    public List<Article> getHeatRankingArticle();
    /***
     * 修改头像
     */
    public boolean modifyHeadImg( Integer id, String modify);

    /***
     * 根据昵称获取id
     * @param name
     * @return
     */
    Integer forNameGetId(String name);
     boolean modifyName(String name);
    /***
     *
     * @param id
     * @return
     */
   boolean loginStatus(Integer id);

    boolean modifyPassword( Integer id, String password);
    User findPassword(Integer id, String password);
    /***
     *
     * @return
     */
    boolean addArticle(Article article);
/***************       对评论的全部方法     ********/
    /***
     * 添加评论
     * @param speak
     * @return
     */
    public boolean addSpeak(Speak speak);
    public boolean deleteSpeak(Integer id);
    public List<Speak> getArticleSpeak(Integer id);
/******************** 全部的类别方法*****************/
    public List<Tag> showAllTagAndCount();
    public List<Article> showAtrcleWhereTag(Integer id);
    public List<Tag> getAlltag();
    public  boolean addTag(String tagName);
    public boolean deleteTag(int id);







    /******************** ——————————帖子管理————————————————*****************/

    List<Article> getArticleNoStatic();
    boolean  modifyArticleStatic(Integer id,  Integer artcle_static);
    boolean deleteArtice(Integer id);




}
